/*
 * XML Type:  ReplyPatternType
 * Namespace: http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd
 * Java type: cgl.narada.wsinfra.schemas.wsr.ReplyPatternType
 *
 * Automatically generated - do not modify.
 */
package cgl.narada.wsinfra.schemas.wsr.impl;
/**
 * An XML ReplyPatternType(@http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd).
 *
 * This is a complex type.
 */
public class ReplyPatternTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.wsinfra.schemas.wsr.ReplyPatternType
{
    
    public ReplyPatternTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName VALUE$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd", "Value");
    private static final javax.xml.namespace.QName REPLYTO$2 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd", "ReplyTo");
    
    
    /**
     * Gets the "Value" element
     */
    public cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues.Enum getValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(VALUE$0, 0);
            if (target == null)
            {
                return null;
            }
            return (cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "Value" element
     */
    public cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues xgetValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues)get_store().find_element_user(VALUE$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "Value" element
     */
    public void setValue(cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues.Enum value)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(VALUE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(VALUE$0);
            }
            target.setEnumValue(value);
        }
    }
    
    /**
     * Sets (as xml) the "Value" element
     */
    public void xsetValue(cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues value)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues)get_store().find_element_user(VALUE$0, 0);
            if (target == null)
            {
                target = (cgl.narada.wsinfra.schemas.wsr.ReplyPatternTypeValues)get_store().add_element_user(VALUE$0);
            }
            target.set(value);
        }
    }
    
    /**
     * Gets the "ReplyTo" element
     */
    public cgl.narada.wsinfra.schemas.reference.ServiceRefType getReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.reference.ServiceRefType target = null;
            target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().find_element_user(REPLYTO$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ReplyTo" element
     */
    public boolean isSetReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(REPLYTO$2) != 0;
        }
    }
    
    /**
     * Sets the "ReplyTo" element
     */
    public void setReplyTo(cgl.narada.wsinfra.schemas.reference.ServiceRefType replyTo)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.reference.ServiceRefType target = null;
            target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().find_element_user(REPLYTO$2, 0);
            if (target == null)
            {
                target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().add_element_user(REPLYTO$2);
            }
            target.set(replyTo);
        }
    }
    
    /**
     * Appends and returns a new empty "ReplyTo" element
     */
    public cgl.narada.wsinfra.schemas.reference.ServiceRefType addNewReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.reference.ServiceRefType target = null;
            target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().add_element_user(REPLYTO$2);
            return target;
        }
    }
    
    /**
     * Unsets the "ReplyTo" element
     */
    public void unsetReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(REPLYTO$2, 0);
        }
    }
}
